package com.dawn.module.hospital.dal.mysql.qrcodepay;


import com.dawn.framework.common.pojo.PageResult;
import com.dawn.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.dawn.framework.mybatis.core.mapper.BaseMapperX;
import com.dawn.module.hospital.dal.dataobject.qrcodepay.QrcodePayDO;
import org.apache.ibatis.annotations.Mapper;
import com.dawn.module.hospital.controller.admin.qrcodepay.vo.*;

/**
 * 扫码支付 Mapper
 *
 * @author root
 */
@Mapper
public interface QrcodePayMapper extends BaseMapperX<QrcodePayDO> {

    default PageResult<QrcodePayDO> selectPage(QrcodePayPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<QrcodePayDO>()
                .eqIfPresent(QrcodePayDO::getUserId, reqVO.getUserId())
                .eqIfPresent(QrcodePayDO::getOpenid, reqVO.getOpenid())
                .likeIfPresent(QrcodePayDO::getOrgName, reqVO.getOrgName())
                .likeIfPresent(QrcodePayDO::getTitle, reqVO.getTitle())
                .eqIfPresent(QrcodePayDO::getOrgCode, reqVO.getOrgCode())
                .likeIfPresent(QrcodePayDO::getPatientName, reqVO.getPatientName())
                .eqIfPresent(QrcodePayDO::getIdCardNo, reqVO.getIdCardNo())
                .eqIfPresent(QrcodePayDO::getPatientId, reqVO.getPatientId())
                .eqIfPresent(QrcodePayDO::getClinicNo, reqVO.getClinicNo())
                .eqIfPresent(QrcodePayDO::getPhone, reqVO.getPhone())
                .eqIfPresent(QrcodePayDO::getHisBillNos, reqVO.getHisBillNos())
                .eqIfPresent(QrcodePayDO::getHisOrderNo, reqVO.getHisOrderNo())
                .eqIfPresent(QrcodePayDO::getOrderType, reqVO.getOrderType())
                .likeIfPresent(QrcodePayDO::getOrderNumber, reqVO.getOrderNumber())
                .eqIfPresent(QrcodePayDO::getAuthCode, reqVO.getAuthCode())
                .eqIfPresent(QrcodePayDO::getThirdOrderNo, reqVO.getThirdOrderNo())
                .eqIfPresent(QrcodePayDO::getAmount, reqVO.getAmount())
                .eqIfPresent(QrcodePayDO::getOtherAmount, reqVO.getOtherAmount())
                .eqIfPresent(QrcodePayDO::getPayStatus, reqVO.getPayStatus())
                .betweenIfPresent(QrcodePayDO::getPayTime, reqVO.getPayTime())
                .eqIfPresent(QrcodePayDO::getPayTypeId, reqVO.getPayTypeId())
                .eqIfPresent(QrcodePayDO::getPayModeName, reqVO.getPayModeName())
                .likeIfPresent(QrcodePayDO::getPayOrderId, reqVO.getPayOrderId())
                .likeIfPresent(QrcodePayDO::getThirdOrderNo, reqVO.getThirdOrderNo())
                .likeIfPresent(QrcodePayDO::getRefundNumber, reqVO.getRefundNumber())
                .eqIfPresent(QrcodePayDO::getRefundPrice, reqVO.getRefundPrice())
                .betweenIfPresent(QrcodePayDO::getRefundTime, reqVO.getRefundTime())
                .eqIfPresent(QrcodePayDO::getRefundReason, reqVO.getRefundReason())
                .eqIfPresent(QrcodePayDO::getRemark, reqVO.getRemark())
                .eqIfPresent(QrcodePayDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(QrcodePayDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(QrcodePayDO::getId));
    }

}